import request from "@/api/request";

// 获取全部风格列表
export function getallstyles() {
    return request({
        method: "GET",
        url: "api/h/styles/",
    });
}

// 根据id获取风格详情
export function getstylesDetails(id) {
    return request({
        method: "GET",
        url: "api/h/styles/" + id + "/",
    });
}

// 上传风格全局方案
export function addstyles(data) {
    return request({
        headers: {
            'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
        },
        method: "POST",
        url: "api/h/styles/",
        data
    });
}

// 获取我的风格设计方案
export function getmystyles() {
    return request({
        method: "GET",
        url: "api/h/my/styles/",
    });
}

// 收藏
export function getfavorite(id) {
    return request({
        method: "POST",
        url: "api/h/styles/"+ id + "/favorite/",
    });
}

// 取消收藏
export function delfavorite(id) {
    return request({
        method: "DELETE",
        url: "api/h/styles/"+ id + "/favorite/",
    });
}


// 投票
export function getvoting(id) {
    return request({
        method: "POST",
        url: "api/h/styles/"+ id + "/voting/",
    });
}

// 取消投票
export function delvoting(id) {
    return request({
        method: "DELETE",
        url: "api/h/styles/"+ id + "/voting/",
    });
}


